{% extends 'base.html' %}
{% block content %}
    <form method="post" action="">
        {% if info %}
            <p class="alert alert-success">
                {{ info }}
            </p>
        {% endif %}
        <table class="table table-striped table-hover table-condensed">
        <thead>
            <tr>
                <th><input onclick="selectAll()" type="checkbox"  name="select_all" style="select_all" id="select_all"/></th>
                <th>ID</th>
                <th>用户名</th>
                <th>姓名</th>
                <th>属组</th>
                <th>is_admin</th>
                <th>is_superuser</th>
                <th>Email</th>
                <th>密钥</th>
                <th>用户信息</th>
                <th>sudo</th>
                <th>sudo</th>
            </tr>
        </thead>
        <tbody>
            {% for user in users %}
            <tr>
                <td><input type="checkbox" name="selected" value="{{ user.id }}"></td>
                <td>{{ user.id }}</td>
                <td>{{ user.username }}</td>
                <td>{{ user.name }}</td>
                <td>
                    {% for group in user.group.all %}
                        {{ group.name }}
                    {% endfor %}
                </td>
                <td>{{ user.is_admin }}</td>
                <td>{{ user.is_superuser }}</td>
                <td>{{ user.email }}</td>
                <td><a href="/downKey/?username={{ user.username }}">下载</a></td>
                <td><a href="/chgUser/?username={{ user.username }}">修改</a></td>
                <td><a href="/showSudo/?username={{ user.username }}">查看</a></td>
                <td><a href="/chgSudo/?username={{ user.username }}">修改</a></td>
            </tr>
            {% endfor %}
        </tbody>
        </form>
    </table>
    <button class="btn btn-primary">删除</button>
    </form>
{% endblock %}